import moment from 'moment'
let startTimeGetter = '2022-06-13 00:00:00'
let endTimeGetter = '2022-06-13 23:59:59'
// let startTimeGetter = ''
// let endTimeGetter = ''
// if (new Date().getHours() < 12) {
//     startTimeGetter = moment().subtract(1, 'day').format('YYYY-MM-DD 08:00')
//     endTimeGetter = moment().format('YYYY-MM-DD HH:mm')
// } else {
//     startTimeGetter = moment().format('YYYY-MM-DD 08:00')
//     endTimeGetter = moment().format('YYYY-MM-DD HH:mm')
// }
const common = {
    state: {
        rightFold: true,
        leftFold: true,
        bottomFold: true,
        twoThree: true,
        realTime: '',
        startTimeCommon: startTimeGetter,
        endTimeCommon: endTimeGetter,
        basinName: '',
        IsloadList: true,//是否进入预演预案加载方案
        Isyuyanyagl: false,//是否在预演预案管理tab页面

    },
    mutations: {
        RIGHTFOLD: (state, rightFold) => {
            state.rightFold = rightFold
        },
        LEFTFOLD: (state, lefld) => {
            state.leftFold = lefld
        },
        BOTTOMFOLD: (state, bottomFold) => {
            state.bottomFold = bottomFold
        },
        TWOTHREE: (state, twoThree) => {
            state.twoThree = twoThree
        },
        SET_Time: (state, realTime) => {
            state.realTime = realTime
        },
        STARTTIMECOMMON: (state, startTimeCommon) => {
            state.startTimeCommon = startTimeCommon
        },
        ENDTIMECOMMON: (state, endTimeCommon) => {
            state.endTimeCommon = endTimeCommon
        },
        BASINNAME: (state, basinName) => {
           // console.log(basinName)
            state.basinName = basinName
        },
        ISLOADLIST: (state, IsloadList) => {
            state.IsloadList = IsloadList
        },
        ISYUYANYAGL: (state, Isyuyanyagl) => {
            state.Isyuyanyagl = Isyuyanyagl
        },
    },
    actions: {
        rightFold: ({ commit }, rightFold) => {
            commit('RIGHTFOLD', rightFold)
        },
        leftFold: ({ commit }, lefld) => {
            commit('LEFTFOLD', lefld)
        },
        bottomFold: ({ commit }, bottomFold) => {
            commit('BOTTOMFOLD', bottomFold)
        },
        twoThree: ({ commit }, twoThree) => {
            commit('TWOTHREE', twoThree)
        },
        setTime: ({ commit }, realTime) => {
            commit('SET_Time', realTime)
        },
        startTimeCommon: ({ commit }, startTimeCommon) => {
            commit('STARTTIMECOMMON', startTimeCommon)
        },
        endTimeCommon: ({ commit }, endTimeCommon) => {
            commit('ENDTIMECOMMON', endTimeCommon)
        },
        basinName: ({ commit }, basinName) => {
            commit('BASINNAME', basinName)
        },
        loadList: ({ commit }, loadList) => {
            commit('LOADLIST', loadList)
        }
    }
}

export default common
